package com.sl.au.service.impl;
/**
 * 片区回款类型分析
 * zty】
 * 2017-02-20
 */
import java.util.List;
import java.util.Map;

import javax.persistence.Entity;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.sl.au.entity.EXDEPayBackTypeArea;
import com.sl.au.repository.EXDEPayAnalyzeAreaRepository;
import com.sl.au.service.EXDEPayAnalyzeAreaService;

@Service("EXDEPayAnalyzeAreaService")
@Transactional
public  class EXDEPayAnalyzeAreaServiceImpl extends BaseServiceImpl implements EXDEPayAnalyzeAreaService {
	@PersistenceContext
	private EntityManager em;
	@SuppressWarnings("unchecked")
	@Override
	public List<EXDEPayBackTypeArea> getMyPage(String beginPaidDate, String endPaidDate, String dept) {
		List<EXDEPayBackTypeArea> pages=null;
		Query query = this.em.createNativeQuery("{call getPayBackTypeArea(?,?,?)}",EXDEPayBackTypeArea.class);//存储过程的名称
		System.out.println(beginPaidDate+","+endPaidDate+","+dept);
		query.setParameter(1, beginPaidDate);
		query.setParameter(2, endPaidDate);
		query.setParameter(3, dept);
		List<EXDEPayBackTypeArea> users = query.getResultList();
		return users;
		
	}
}
